<?php
/* [DoYouHaoBaby!] (C)Dianniu From 2010.
   this($)*/

!defined('DYHB_PATH') && exit;

class TemplateGtkGladeWidgetCompiler_GtkWindow extends TemplateGtkGladeWidgetCompiler_GtkContainer{

	protected function compileCreateWidget_(TemplateGtkGladeWidget $oObject){
		$sWidgetClass=$oObject->getWidgetClass();
		$sVariableName='$'.TemplateGtkGlade::getWidgetVariableName($oObject);
		if(($sValue=$oObject->getProperty('type'))!==null){$sValue=str_replace('GTK_','Gtk::',$sValue);}// 窗口类型
		else{$sValue='';}
		$sCompiled="\t\t{$sVariableName}=new {$sWidgetClass}({$sValue});";// 构造函数
		$this->setStringInt_($oObject,$sCompiled,'title');// 窗口标题
		$this->setStringInt_($oObject,$sCompiled,'role');// 窗口角色
		$this->setBool_($oObject,$sCompiled,'resizable');// 可变大小
		$this->setBool_($oObject,$sCompiled,'modal');// 模态
		$this->setStringInt_($oObject,$sCompiled,'window_position',false,'set_position');// 窗口位置
		$this->setBool_($oObject,$sCompiled,'destroy_with_parent');// 随主窗口关闭
		$this->setStringInt_($oObject,$sCompiled,'icon');// 图标
		$this->setStringInt_($oObject,$sCompiled,'icon_name');// 图标名称
		$this->setStringInt_($oObject,$sCompiled,'type_hint',false);// 类型提示
		$this->setBool_($oObject,$sCompiled,'skip_taskbar_hint');// 跳过任务栏
		$this->setBool_($oObject,$sCompiled,'skip_pager_hint');// 跳过窗口选择器
		$this->setBool_($oObject,$sCompiled,'accept_focus');// 接受焦点
		$this->setBool_($oObject,$sCompiled,'focus_on_map');// 映射时获得焦点
		$this->setBool_($oObject,$sCompiled,'decorated');// 装饰
		$this->setStringInt_($oObject,$sCompiled,'transient_for',false);// Transient Window
		return $sCompiled;
	}

	static public function regToProcessorManager(ITemplateObjProcessorManager $oManager){
		$oManager->regProcessor(str_replace('TemplateGtkGladeWidgetCompiler_','',__CLASS__),__CLASS__);
	}

}
